import { Connection } from 'typeorm';

import { DB_CONNECTION_TOKEN, ROLE_REPO } from '../../const';
import { RoleEntity } from './role.entity';

export const RoleProviders = [
  {
    provide: ROLE_REPO,
    inject: [DB_CONNECTION_TOKEN],
    useFactory: (connection: Connection) => connection.getRepository(RoleEntity),
  },
];
